/*
 * @Author: CPS
 * @Date: 2020-07-14 11:37:35
 * @Last Modified by: CPS
 * @Last Modified time: 2020-08-06 17:49:34
 * @Projectname Electron-YYS
 * @Filename main.config.js
 */

'use strict'
const {
  app,
  // screen
} = require('electron')
const APPPATH = app.getAppPath();
const path = require('path');

// const display = screen.getPrimaryDisplay()
// const displayWidth = display.bounds.width
// const displayHeight = display.bounds.height

let mainConfig = {
  template: path.resolve(APPPATH, 'build/fileWatcher.html'),
  width: 600,
  height: 800,
  autoHideMenuBar: false, //隐藏菜单栏
  // titleBarStyle: 'hidden',
  transparent: false, //窗口透明
  frame: false, //无边框模式-无法移动
  resizable: true, //调整大小开关
  movable: true, //移动开关
  maximizable: true, //是否可以最大化
  alwaysOnTop: false, //置顶开关
  opacity: 1, //透明度0.0 - 1.0
  webPreferences: {
    devtools: false,
    nodeIntegration: true, //渲染进程可以引入
    nodeIntegrationInWorker: false, //启动多线程
    preload: path.resolve(APPPATH, 'build/renderer/preload.js'), //预处理
  }
}

let sonConfig = {
  template: path.resolve(APPPATH, 'build/sonWindowTemplate.html'),
  width: 854,
  height: 480,
  //frame: false, //无边框模式-无法移动
  autoHideMenuBar: true, //隐藏菜单栏
  //transparent: false, //窗口透明
  resizable: false, //调整大小开关
  movable: false, //移动开关
  maximizable: false, //是否可以最大化
}

let subConfig = {
  template: path.resolve(APPPATH, 'build/windowMsg.html'),
  width: 300,
  height: 200,
  //frame: false, //无边框模式-无法移动
  autoHideMenuBar: true, //隐藏菜单栏
  //transparent: false, //窗口透明
  resizable: false, //调整大小开关
  movable: false, //移动开关
  maximizable: false, //是否可以最大化
  webPreferences: {
    nodeIntegration: true, //渲染进程可以引入
    nodeIntegrationInWorker: false, //启动多线程
  }
}


module.exports = {
  mainConfig,
  sonConfig,
  subConfig,
}